package com.ruoyi.web.web.dto;

import lombok.Data;

/***
 * 表示响应状态
 */
@Data
public class MessageDto {
    private Integer code;
    private String message;

    public MessageDto(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static MessageDto ok() {
        return new MessageDto(200, "OK");
    }

    public static MessageDto error() {
        return new MessageDto(500, "error");
    }

    public static MessageDto error(String message) {
        return new MessageDto(500, message);
    }

    public static Object error(int code, String message) {
        return new MessageDto(500, message);
    }
}
